<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: aliceblue;
        }

        .box {
            position: relative;
            perspective: 800px;
            perspective-origin: top right;
            width: 400px;
            height: 400px;
            margin: auto 400px;
            border: 2px solid white;
            border-radius: 4px;
        }

        .cube {
            position: absolute;
            width: 200px;
            height: 200px;
            transform-style: preserve-3d;
            margin: auto;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            animation: move 10s ease-in-out infinite;
        }

        .side {
            position: absolute;
            width: 100%;
            height: 100%;
            opacity: 0.6;
            border: 2px solid white;
            text-align: center;
            line-height: 200px;
        }

        .front {
            background-color: aqua;
            transform: translateZ(100px);
        }

        .back {
            background-color: aqua;
            transform: rotateY(180deg) translateZ(-100px);
        }

        .left {
            background-color: aqua;
            transform: translateX(-100px) rotateY(-90deg);
        }

        .right {
            background-color: aqua;
            transform: translateX(100px) rotateY(90deg);
        }

        .top {
            background-color: aqua;
            transform: translateY(-100px) rotateX(90deg);
        }

        .bottom {
            background-color: aqua;
            transform: translateY(100px) rotateX(-90deg);
        }

        @keyframes move {
            0% {
                transform: translate(-50%, -50%) rotateY(0deg) rotateX(720deg) rotateZ(0deg);
            }

            100% {
                transform: translate(-50%, -50%) rotateY(360deg) rotateX(0deg) rotateZ(360deg);
            }
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="cube">
            <div class="side front">前</div>
            <div class="side left">左</div>
            <div class="side back">后</div>
            <div class="side top">顶</div>
            <div class="side bottom">底</div>
            <div class="side right">右</div>
        </div>
    </div>
</body>

</html>